package shajie.shajun.mmhf.View.Fragment;

import shajie.shajun.mmhf.Adapter.GridViewAdapter;
import shajie.shajun.mmhf.Base.BaseFragment;
import shajie.shajun.mmhf.Bean2.Result;
import shajie.shajun.mmhf.Public_Data;
import shajie.shajun.mmhf.R;
import shajie.shajun.mmhf.ViewModel.Bmobdata;
import shajie.shajun.mmhf.databinding.FragmentPictureBinding;

/**
 * Created by admin on 2018/1/22.
 */

public class Picture_Fragmnt extends BaseFragment<FragmentPictureBinding> {
    private FragmentPictureBinding mbinding;
    private String[] picurl;
    @Override
    public int setlayoutid() {
        return R.layout.fragment_picture;
    }

    @Override
    public void init(FragmentPictureBinding binding) {
        this.mbinding=binding;
        Public_Data.number++;
        Bmobdata.getpicture(getContext(),"ActiviteImage", new Bmobdata.Singer<Result>() {
            @Override
            public void success(Result s) {
                picurl=s.getResult().split("\\+");
                GridViewAdapter gridAdapter=new GridViewAdapter(getContext(),picurl,true,R.layout.item_picture_fragment,getFragmentManager());
                mbinding.gridPicture.setAdapter(gridAdapter);
            }

            @Override
            public void faile(String s) {

            }
        });
    }
}
